/*
LABOR3D Rendering Engine . (http://gforge.osdn.net.cn/projects/LABOR3d/) 
Stanly.Lee 2006


This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

#ifndef __LABOR3D_LOGGER_H__
#define __LABOR3D_LOGGER_H__
#include "../LaborCoreDef.h"

namespace std {  class ICustomLogger; }
NAMESPACE_LABOR3D_BEGIN

enum eLL_LOG_LEVEL
{
    eLLL_SHOW_ALL    = 0,
    eLLL_DEBUG_TIPS  = 10,
    eLLL_SHOW_DEBUG_NORMAL  = 99,
	eLLL_DEBUG_NORMAL       = 100,
    eLLL_SHOW_DEBUG_HIGH    = 999,
	eLLL_DEBUG_HIGH         = 1000,
    eLLL_SHOW_ONLY_ERRO     = 9999,
	eLLL_ERROR_NORMAL       = 10000,
	eLLL_ERROR_FALT       = 100000,
};


void LABORCORE_API       LABOR_LOG_SET_LEVEL(eLL_LOG_LEVEL lv);
void LABORCORE_API       LABOR_LOG_REDIR(const wchar_t* fileName);
void LABORCORE_API       LABOR_LOG_CLOSE();
void LABORCORE_API       LABOR_LOG_SET_CUSTOM_LOGGER(std::ICustomLogger* pLogger);
void LABORCORE_API       LABOR_LOG(eLL_LOG_LEVEL logLevel , const wchar_t * fmt , ...);
///==== ansi===///
void LABORCORE_API       LABOR_LOG_A(eLL_LOG_LEVEL logLevel , const char * fmt , ...);
///==== ansi===///
void LABORCORE_API       LABOR_PRINTF_LOG(const wchar_t * fmt , ...);
void LABORCORE_API       LABOR_LOGTOFILE(eLL_LOG_LEVEL logLevel , const wchar_t * fmt , ...);
void LABORCORE_API       LABOR_LOG_FLUSH();
void LABORCORE_API       LABOR_LOG_AUTOFLUSH(bool bAutoFlush);
bool LABORCORE_API       LABOR_LOG_ISATUOFLUSH();
bool LABORCORE_API       LABOR_SVAE_LOGINFO_FILE(const wchar_t* fileName , const wchar_t* data );
#ifdef _DEBUG
#define LABOR_ASSERT(val , strLog)  do{ if( val == false) LABOR_LOG(eLLL_DEBUG_HIGH,strLog) ; }while(0);
#else
#define LABOR_ASSERT(val , strLog) 
#endif

#define LABOR_ASSERT_POINTER(p , strLog) LABOR_ASSERT(p != NULL , strLog)

#define LABOR_WARNNING_NOT_IMPLEMENT           LABOR_LOG(eLLL_DEBUG_HIGH,"%s(%d): very important function is not implemented: %s   \n",__FILE__ , __LINE__ ,__FUNCTION__);
#define LABOR_WARNNING_NOT_IMPLEMENT_INFO(s)   LABOR_LOG(eLLL_DEBUG_HIGH,"%s(%d): function=[%s]  %s  \n",__FILE__ , __LINE__ ,__FUNCTION__ , s);
NAMESPACE_LABOR3D_END

#endif

